Ext.define('Admin.view.auth.Dialog', {
	        extend : 'Ext.form.Panel',
	        xtype : 'authdialog',

	        requires : ['Admin.view.auth.AuthenticationController', 'Ext.form.Panel'],

	        viewModel : true,
	        controller : 'authentication',

	        /*
			 * Seek out the first enabled, focusable, empty textfield when the form is focused
			 */
	        defaultFocus : 'textfield:focusable:not([hidden]):not([disabled]):not([value])',

	        /**
			 * @cfg {Boolean} [autoComplete=false] Enables browser (or Password Managers) support for autoCompletion of
			 *      User Id and password.
			 */
	        autoComplete : false,

	        enforceValid : true,

	        fireDefaultButton : function(e) {
		        var btn = this.getReferences()[this.defaultButton];

		        if (btn && btn.click) {
			        btn.click(e);
			        e.stopEvent();
			        return false;
		        }
	        },

	        initComponent : function() {
		        var me = this, listen;

		        if (me.autoComplete) {
			        // Use standard FORM tag for detection by browser or password tools
			        me.autoEl = Ext.applyIf(me.autoEl || {}, {
				                tag : 'form',
				                name : 'authdialog',
				                method : 'post'
			                });
		        }

		        me.addCls('auth-dialog');
		        me.callParent();

		        if (me.autoComplete) {
			        listen = {
				        afterrender : 'doAutoComplete',
				        scope : me,
				        single : true
			        };

			        Ext.each(me.query('xtextfield'), function(field) {
				                field.on(listen);
			                });
		        }
	        },

	        doAutoComplete : function(target) {
		        if (target.inputEl && target.autoComplete !== false) {
			        target.inputEl.set({
				                autocomplete : 'on'
			                });
		        }
	        }
        });
